import com.alibaba.moco.RedisPoolInstance
import net.sf.json.JSONObject
import org.apache.commons.lang.StringUtils

/**
 * 模拟 滴滴 获取全部订单
 * Created by wb-lj240895 on 2016/11/1.
 */
def excute(request){
    def orders = []
    def redis = RedisPoolInstance.getRedisClient()
    Set<String> orderIds = redis.keys("*")
    for (String orderId : orderIds) {
        if (StringUtils.isBlank(orderId)) {
            def orderStr = redis.get(orderId)
            def orderJsn = JSONObject.fromObject(orderStr)
            if (orderJsn.containsKey("order")){

            }
            orders.add(orderJsn)
        }
    }
    return orders
}
